﻿<div ng-controller="featureController">
	<div class="wrapper border-bottom white-bg page-heading">
		<div class="col-lg-pull-12">
			<ol class="breadcrumb">
				<li>{{query.type==1?"后台功能":"商户功能"}}</li>
			</ol>
		</div>
	</div>
	<div class="row ui-box">
		<div class="col-md-12">
			<a class="btn btn-primary btn-sm" ui-sref="app.manage.feature_detail({type:query.type,action:'add'})"><i class="fa fa-plus"></i> 添加</a>
		</div>
	</div>
	<table class="table table-hover m-t-md">
		<thead>
			<tr style="background-color: #f7f7f9;">
				<th>名称</th>
				<th>地址</th>
				<th>排序</th>
				<th>类型</th>
				<th>备注</th>
				<th>管理</th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="item in list">
				<td><span ng-if="item.parent_id!=0" style="padding-left:{{20*(item.depth-1)}}px;"></span> <i ng-if="item.icon" class="fa" ng-class="item.icon"></i> {{item.name}}</td>
				<td>{{item.url}}</td>
				<td>{{item.sort}}</td>
				<td>{{item.type==1?"后台":"商户"}}</td>
				<td>{{item.remark}}</td>
				<td>
					<a class="btn btn-primary btn-xs" ui-sref="app.manage.feature_detail({type:item.type,pid:item.id,action:'add'})"><i class="fa fa-plus"></i> 添加子级</a>
					<a class="btn btn-primary btn-xs" ui-sref="app.manage.feature_detail({id:item.id,action:'edit'})"><i class="fa fa-cog"></i> 编辑</a>
					<a ng-if="list.length==$index+1||item.id!=list[$index+1].parent_id" class="btn btn-primary btn-xs" ng-click="remove(x)"><i class="fa fa-trash"></i> 删除</a>
				</td>
			</tr>
		</tbody>
	</table>
</div>